<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1 v-bind:title="title">标题</h1>
        <p>{{message}}</p>
        <p v-if="seen">你看见我了</p>
        <p v-else>什么都没有</p>
        <ul>
            <li v-for="stu in students">
                {{stu.name}},{{stu.age}}
            </li>
        </ul>
        <button type="button" v-on:click="handleClick">change</button>
        <input type="text" v-model="message">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                message:"hello vue",
                title:"hello",
                seen:false,
                students:[
                    {name:"张飞",age:30},
                    {name:"刘备",age:35},
                    {name:"关羽",age:32}
                ]
            },
            methods:{
                handleClick(){
                    this.message = this.message.split("").reverse().join("");
                }
            }
        });
    </script>
</body>
</html>